interface _CS_ {
    /**
     * 转化为驼峰标识
     * @param str 字符串
     * @param separator <'_'> 分隔符
     * @returns 字符串
     */
    camelCase(str: string, separator?: '_' | string): string;
}
{
    Object.defineProperty(_CS_.prototype, 'camelCase', {
        writable: false,
        configurable: false,
        enumerable: false,
        value: (str: string, separator: string = '_') => {
            const result = [];
            const groups = str.split(separator);
            for (let i = 0; i < groups.length; i++) {
                const group = groups[i];
                let lower = i !== 0;
                for (let j = 0; j < group.length; j++) {
                    const c = group[j];
                    if (/[A-Z]$/.test(c)) {
                        if (!lower) {
                            result.push(c.toLowerCase());
                        } else {
                            lower = false;
                            result.push(c);
                        }
                    } else {
                        lower = true;
                        result.push(c);
                    }
                }
            }
            return result.join('');
        }
    });
}
